package lib.self.fresco.provider;

import android.content.Context;
import android.widget.ImageView;

import lib.self.fresco.NetworkImageListener;
import lib.self.fresco.renderer.BaseRenderer;

/**
 * description:提供图片基本操作
 * author: Steven Xiao
 * date: 2017/4/27
 */
public abstract class BaseProvider {
    private Context mContext;
    private ImageView mIv;
    protected NetworkImageListener mListener;

    public BaseProvider(Context mContext, ImageView iv) {
        this.mContext = mContext;
        this.mIv = iv;
    }

    public Context getContext() {
        return mContext;
    }

    public ImageView getIv() {
        return mIv;
    }

    public abstract void load(String url, int placeHolderRid, BaseRenderer renderer, int fadeDuration);

    public void setListener(NetworkImageListener listener) {
        this.mListener = listener;
    }

    public void clearFromCache(String url) {

    }
}
